<?php
class Index_con extends Lxbase{
	public $vqconn;
	public $pla;
	public $plarr;
	public function __construct(){
		parent::__construct();
		$vqdbary = Lxbase::getconfig("olddb");
		$this->vqconn=new Lxbase($vqdbary);
		$this->plarr = array(4=>array("name"=>"微信公众号","a"=>"wxpla"),9=>array("name"=>"独立APP","a"=>"apppla"),13=>array("name"=>"移动站","a"=>"companys"));
		$this->pla=intval($_GET["pla"]);
   }
   
   //抓取文章
   public function search2img(){
	   if(!empty($_POST)){
		   $cid=intval($_POST["cid"]);
		   $key=$_POST["key"];
		   $ip='103.7.221.101';
		   $port='10001';
		   $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
			$result = socket_connect($socket, $ip, $port);
			$in = "ZSWAPQUE2";
			socket_write($socket, $in, strlen($in));
			while ($out = socket_read($socket, 8192)) {
				echo $out;
			}
			echo "closeing socket..";
			socket_close($socket);
			echo "ok .\n\n";
	   }
	   $usertoken = $this->oncedata("token","users","where id={$this->userinfo['userid']}");
	   $clist = $this->vqconn->arrdata("id,name","classify","where token='{$usertoken}' and fid=0");
	   $this->smarty->assign("clist",$clist);
	   $this->smarty->display("search2img.tpl");
   }
}